#include<iostream>
#include<vector>
using namespace std;

class Creditor
{
   public:
   virtual void takemoney()=0;
   virtual ~Creditor(){};

};
class lender
{
  public:
   virtual void borrow(Creditor*crediter)=0;
   virtual void notifyallCreditor()=0;
   virtual ~lender(){}

};
class zhangsan: public lender
{
  public:
   void borrow(Creditor*crediter)override
   {
      st.push_back(crediter);

   }
   void notifyallCreditor()override
   {
     for(auto e:st)
     {

     e->takemoney();



     }

   }

  private:
  vector<Creditor*>st;
};

class boss1 :public Creditor
{

 public:
 void takemoney()override
 {
   cout<<"boss1 要钱"<<endl;

 }

};
class boss2 :public Creditor
{

 public:
 void takemoney()override
 {
   cout<<"boss2 要钱"<<endl;

 }

};

class boss3 :public Creditor
{

 public:
 void takemoney()override
 {
   cout<<"boss3 要钱"<<endl;

 }

};

int main()
{
  zhangsan t4;
  boss1 t1;
  boss2 t2;
  boss3 t3;
  t4.borrow(&t1);
  t4.borrow(&t2);
  t4.borrow(&t3);
  t4.notifyallCreditor();

}
